package org.qqcui.designpattern.patterns.watcher.observer;

/**
 * desc
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/6 15:22
 **/
public class BaiduSite implements Observer {

    private float temperature;

    private float pressure;

    private float humidity;

    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    private void display() {
        System.out.println("*** Baidu Today temperature: " + temperature + " ***");
        System.out.println("*** Baidu Today pressure: " + pressure + " ***");
        System.out.println("*** Baidu Today humidity: " + humidity + " ***");
    }
}
